package com.ibsol.service
{
	import com.ibsol.database.CurrencyDAO;
	
	import mx.collections.ArrayCollection;
	
	public class CurrencyService
	{
		private var currencyDAO:CurrencyDAO;
		public function CurrencyService()
		{
			this.currencyDAO = new CurrencyDAO();
		}
		//find ExchangeRate By changeFrom and changeTo
		public function findExchangeRate(changeFrom:String,changeTo:String):ArrayCollection{
			return currencyDAO.findExchangeRateByFromAndTo(changeFrom,changeTo);
		}
		//find DISTINCT changeFrom
		public function findChangeFromOfAll():ArrayCollection{
			return currencyDAO.findChangeFromAll();
		}
		//find ExchangeRate by changeFrom
		public function findExchangeRateByFrom(changeFrom:String):ArrayCollection{
			return currencyDAO.findExchangeRateByFrom(changeFrom);
		}
		//update ExchangeRate
		public function updateExchangeRate(rate:String,changeFrom:String,changeTo:String):void{
			currencyDAO.updateExchangeRate(rate,changeFrom,changeTo);
		}
	}
}